summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/hid_core/resources/abstracted_pad/abstract_sixaxis_handler.cpp2
-rw-r--r--src/hid_core/resources/npad/npad.cpp6
-rw-r--r--src/hid_core/resources/touch_screen/touch_screen_resource.cpp8
3 files changed, 8 insertions, 8 deletions
diff --git a/src/hid_core/resources/abstracted_pad/abstract_sixaxis_handler.cpp b/src/hid_core/resources/abstracted_pad/abstract_sixaxis_handler.cpp
index 6d759298e..0dde244ef 100644
--- a/src/hid_core/resources/abstracted_pad/abstract_sixaxis_handler.cpp
+++ b/src/hid_core/resources/abstracted_pad/abstract_sixaxis_handler.cpp
@@ -57,7 +57,7 @@ Result NpadAbstractSixAxisHandler::UpdateSixAxisState() {
Core::HID::NpadIdType npad_id = properties_handler->GetNpadId();
for (std::size_t i = 0; i < AruidIndexMax; i++) {
auto* data = applet_resource_holder->applet_resource->GetAruidDataByIndex(i);
- if (data->flag.is_assigned) {
+ if (data == nullptr || !data->flag.is_assigned) {
continue;
}
auto& npad_entry = data->shared_memory_format->npad.npad_entry[NpadIdTypeToIndex(npad_id)];
diff --git a/src/hid_core/resources/npad/npad.cpp b/src/hid_core/resources/npad/npad.cpp
index fe3fdc5cd..053625b55 100644
--- a/src/hid_core/resources/npad/npad.cpp
+++ b/src/hid_core/resources/npad/npad.cpp
@@ -131,7 +131,7 @@ void NPad::ControllerUpdate(Core::HID::ControllerTriggerType type, std::size_t c
auto* data = applet_resource_holder.applet_resource->GetAruidDataByIndex(aruid_index);
- if (!data->flag.is_assigned) {
+ if (data == nullptr || !data->flag.is_assigned) {
continue;
}
@@ -463,13 +463,13 @@ void NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing) {
std::scoped_lock lock{*applet_resource_holder.shared_mutex};
for (std::size_t aruid_index = 0; aruid_index < AruidIndexMax; ++aruid_index) {
const auto* data = applet_resource_holder.applet_resource->GetAruidDataByIndex(aruid_index);
- const auto aruid = data->aruid;
- if (!data->flag.is_assigned) {
+ if (data == nullptr || !data->flag.is_assigned) {
continue;
}
bool is_set{};
+ const auto aruid = data->aruid;
npad_resource.IsSupportedNpadStyleSet(is_set, aruid);
// Wait until style is defined
if (!is_set) {
diff --git a/src/hid_core/resources/touch_screen/touch_screen_resource.cpp b/src/hid_core/resources/touch_screen/touch_screen_resource.cpp
index 56e8e8e51..c39321915 100644
--- a/src/hid_core/resources/touch_screen/touch_screen_resource.cpp
+++ b/src/hid_core/resources/touch_screen/touch_screen_resource.cpp
@@ -63,7 +63,7 @@ Result TouchResource::ActivateTouch(u64 aruid) {
auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index);
TouchAruidData& touch_data = aruid_data[aruid_index];
- if (!applet_data->flag.is_assigned) {
+ if (applet_data == nullptr || !applet_data->flag.is_assigned) {
touch_data = {};
continue;
}
@@ -124,7 +124,7 @@ Result TouchResource::ActivateGesture(u64 aruid, u32 basic_gesture_id) {
auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index);
TouchAruidData& touch_data = aruid_data[aruid_index];
- if (!applet_data->flag.is_assigned) {
+ if (applet_data == nullptr || !applet_data->flag.is_assigned) {
touch_data = {};
continue;
}
@@ -324,7 +324,7 @@ Result TouchResource::SetTouchScreenConfiguration(
const auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index);
TouchAruidData& data = aruid_data[aruid_index];
- if (!applet_data->flag.is_assigned) {
+ if (applet_data == nullptr || !applet_data->flag.is_assigned) {
continue;
}
if (aruid != data.aruid) {
@@ -344,7 +344,7 @@ Result TouchResource::GetTouchScreenConfiguration(
const auto* applet_data = applet_resource->GetAruidDataByIndex(aruid_index);
const TouchAruidData& data = aruid_data[aruid_index];
- if (!applet_data->flag.is_assigned) {
+ if (applet_data == nullptr || !applet_data->flag.is_assigned) {
continue;
}
if (aruid != data.aruid) {